﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WUEnterPriseSpaceLeftMaps.ascx.cs" Inherits="NJL.WebUsers.Controls.WUEnterPriseSpaceLeftMaps" %>
    <div class="box">
        <div class="titlenews">
            <h2>
                交通指南</h2>
        </div>
        <div class="leftcont">
            <script type='text/javascript' src='http://api.map.baidu.com/api?v=1.2' ></script>
            <div id="container" style='width: 254px; height: 300px'>
            </div>
            <script type='text/javascript'>
                var map = new BMap.Map("container");
                map.centerAndZoom(new BMap.Point(116.404, 39.915), 11);
                // 创建地址解析器实例
                map.addControl(new BMap.NavigationControl());
                map.addControl(new BMap.ScaleControl());
                map.addControl(new BMap.OverviewMapControl());

                var myGeo = new BMap.Geocoder();
                // 将地址解析结果显示在地图上，并调整地图视野
                myGeo.getPoint("<%=modelCompany.MAP_ADDRESS==null?modelCompany.ADDRESS:modelCompany.MAP_ADDRESS %>", function (point) {
                    if (point) {
                        map.centerAndZoom(point, 16);
                        map.addOverlay(new BMap.Marker(point));
                        var opts = {
                            width: 80,     // 信息窗口宽度
                            height: 20,     // 信息窗口高度
                            title: "<%=modelCompany.COMPANY_NAME %>"   // 信息窗口标题
                        }
                        var infoWindow = new BMap.InfoWindow("<%=modelCompany.ADDRESS %>", opts);  // 创建信息窗口对象   
                        map.openInfoWindow(infoWindow, map.getCenter());      // 打开信息窗口  

                    }
                }, "<%=GetAreaName(modelCompany.AREA_CODE) %>");
            </script>
            <div class="cont">
                <p>
                   <asp:Literal ID="litTraffic" runat="server"></asp:Literal></p>
            </div>
        </div>
    </div>
